package com.practicario.mvc
{
    import com.practicario.mvc.controller.*;
    import com.practicario.mvc.model.*;
    import com.practicario.mvc.model.vo.StudentProfileVO;
    import com.practicario.mvc.model.vo.TeacherProfileVO;
    import com.practicario.mvc.view.*;
    
    import org.puremvc.as3.interfaces.*;
    import org.puremvc.as3.patterns.facade.*;
    import org.puremvc.as3.patterns.proxy.*;
   
    public class ApplicationFacade extends Facade
    {
       	public static const STARTUP:String = "startup";
        public static const DO_LOG_IN:String = "do_log_in";
        public static const DO_LOG_IN_SUCCESS:String = "do_log_in_success";
        public static const UPDATE_PROFILE:String = "update_profile";
        
        public static var teacherProfileVO:TeacherProfileVO = new TeacherProfileVO();
        public static var studentProfileVO:StudentProfileVO = new StudentProfileVO();
       		
        public static function getInstance() : ApplicationFacade 
		{
            if ( instance == null ) instance = new ApplicationFacade( );
            return instance as ApplicationFacade;
        }

        override protected function initializeController( ) : void 
        {
            super.initializeController(); 
            registerCommand( STARTUP, ApplicationStartupCommand ); 
            registerCommand( DO_LOG_IN, LoginAccessCommand );
            registerCommand( UPDATE_PROFILE, UpdatePerfilCommand);                                    
        }
		
		public function startup( app:Practicario ):void
		{
			sendNotification( STARTUP, app );
		}
		
    }
}